<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>投资人认证</title>
		<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css"/>
		<link rel="stylesheet" type="text/css" href="../css/style.css"/>
		<link rel="stylesheet" href="../css/leftSidebar.css">
	</head>
	<style type="text/css">
	html,body{height: 100%;padding-bottom: 50px;}
		.col-xs-12.nav_right{padding: 0;height: 100px;padding-right: 0;margin-right: 0;min-width: 1100px;height: 100px;padding-right: 0;margin-right: 0;padding-left: 160px;}
		#myTab a{color: #7c7c7c; ;font-size: 15px;}
		#myTab>li.active>a{color: #3f4142; background-color: #fff;}
		.navbar-form{margin-top: 0;}
		.tab_creat .active{color:#6bc50d;}
		.table>tbody>tr.active>td, .table>tbody>tr.active>th, .table>tbody>tr>td.active, .table>tbody>tr>th.active, .table>tfoot>tr.active>td, .table>tfoot>tr.active>th, .table>tfoot>tr>td.active, .table>tfoot>tr>th.active, .table>thead>tr.active>td, .table>thead>tr.active>th, .table>thead>tr>td.active, .table>thead>tr>th.active{background-color: #fff;}
		.table>tfoot>tr.active>td{background-color: #fff;}
		.table>tbody>tr>td{border-top:0;}
		.table{margin-bottom: 0;}
		div.tab_creat.row{background-color: #fff;}
		.tab_font{padding: 10px 0;}
		.tab_font div,.tab_font td{font-size: 14px; ;color: #919191;}
		.gongsi_list div.col-xs-2{padding-top:10px;padding-bottom: 10px;text-align: center;}
		.gongsi_list.row{padding: 20px;background-color: #fff;margin-top: 20px;border: 1px solid #ddd;}
		.gongsi_list dd div.col-xs-2{height: 60px;line-height: 60px;font-size: 14px; ;color: #4f5051;}
		.row{margin: 0;	}
		
		.sub_logo{position: relative;display: inline-block;padding-left: 0;}
		.sub_logo input{opacity: 0;position: absolute;width: 100%;top: 0;bottom: 0;}
		.zhube_head{border-bottom: 1px solid #ddd;}
		.zhube_head h3{padding:10px 5px 30px;, ;color: #222c38;font-size: 18px;font-weight: bold;}
			
		#form_test label{font-size: 14px; ;color: #515151;font-weight: normal;}
		#form_test  .media-middle{font-size: 14px;color: #acacac;}
		.form_tip{font-size: 12px;color: #acacac; ;}
		.btn-default{border-color: #d5272d;color: #d5272d;}
		.btn-default.disabled{background-color: #ccc;color: #fff;border-color:#ccc;}
		.btn-default.disabled.focus, .btn-default.disabled:focus, .btn-default.disabled:hover, .btn-default[disabled].focus, .btn-default[disabled]:focus, .btn-default[disabled]:hover, fieldset[disabled] .btn-default.focus, fieldset[disabled] .btn-default:focus, fieldset[disabled] .btn-default:hover{background-color: #ccc;color: #fff;}
		.btn_next{width: 220px;}
		.btn_next,.btn_back{margin-bottom: 50px;}
		
		.zhube_head>div{padding-bottom: 15px; color: #d5272d;font-size: 16px;}
		.zhube_head>div>.active{color: #919191;}
		
		#form_check label.col-xs-2 {padding:15px 0;}
	</style>
	<body style="background-color: #f2f2f2;">
		<div class="row warp" style="height: 100%;">
			<div class="nav_right_head">
				<a href="../index.html"><img src="../img/roleIndexBg.jpg"/></a>
			</div>
			<!--左侧导航-->
			<div class="col-xs-2 nav_left">
				<div class="creatNav">投资人服务</div>
				<div class="creatLoginStatus"><img src="../img/avtar.png"><a>您好，投资人</a></div>
				<div class="list-group" style="padding: 0;">
					<a href="touziren_index.html" class="list-group-item "><i class="glyphicon glyphicon-home"></i> 首页</a>
					<a href="touziren_renzheng.html" class="list-group-item active"><i class="glyphicon glyphicon-education"></i> 投资人认证</a>
					<a href="touziren_tjxm.html" class="list-group-item"><i class="glyphicon glyphicon-folder-open"></i> 推荐的项目</a>
					<a href="touziren_tzxm.html" class="list-group-item"><i class="glyphicon glyphicon-usd"></i> 投资的项目</a>
					<a href="touziren_mynews.html" class="list-group-item" ><i class="glyphicon glyphicon-book"></i> 我的消息</a>
					<a href="touziren_lydt.html" class="list-group-item"><i class="glyphicon glyphicon-search"></i> 项目搜索</a>
				</div>
				<div class="backBtn"> <a href="../index.html"><img src="../img/backIndex.png"></a></div>
			</div>
			
			<div class="col-xs-12 nav_right">

				
				
			
					<div class="row" style="margin-top: 10px;">
						<div class="col-xs-8 col-xs-offset-2  zhuche_progress1" >
							<div class="zhube_head clearfix">
								<h3 class="text-center">认证投资人</h3>
								<div class="row text-center"><span class="col-xs-4 ">第一步：提交身份信息</span> <span class="col-xs-4">>>></span><span class="col-xs-4 active">第二步：提交偏好信息</span></div>
							</div>
							<form class="form-horizontal" id="form_test" style="padding: 20px 0;"> 
							  <div class="form-group">
							    <label for="realName" class="col-sm-3 control-label">真实姓名</label>
							    <div class="col-sm-8">
							      <input type="text" class="form-control" id="realName" datatype='*' nullmsg='请输入真实姓名!' placeholder=" 为了保证创业者的沟通体验，请确保为真实姓名 ">
							    </div>
							  </div>
							  <div class="form-group">
							    <label for="email" class="col-sm-3 control-label">邮箱</label>
							    <div class="col-sm-8">
							      <input type="email" name="email" class="form-control" datatype='*' nullmsg='请输入邮箱!'  id="email" placeholder="输入邮箱">
							    </div>
							  </div>
							 
							   <div class="form-group">
							    <label for="weChat" class="col-sm-3 control-label">微信</label>
							    <div class="col-sm-8">
							      <input type="text" class="form-control" id="weChat" datatype='*' nullmsg='请输入微信号码!' placeholder="输入微信号">
							    </div>
							  </div>
							   <div class="form-group">
							    <label for="identity" class="col-sm-3 control-label">投资人身份</label>
							    <div class="col-sm-8">
							     <select class="form-control" id="identity">
									  <option>投资机构</option>
									  <option>个人</option>
									</select>
							    </div>
							  </div>
							  <div class="form-group">
							    <label for="institution" class="col-sm-3 control-label">所属机构</label>
							    <div class="col-sm-8">
							      <input type="text" class="form-control" id="institution" datatype='*' nullmsg='请输入单位名称' placeholder="输入单位名称">
							    </div>
							  </div>
							  
							    <div class="form-group">
							    <label for="dept" class="col-sm-3 control-label">职位</label>
							    <div class="col-sm-8">
							      <input type="text" class="form-control" id="dept" datatype='*' nullmsg='请输入职位!' placeholder="输入职称">
							    </div>
							  </div>
								<button class="btn btn-default center-block btn_next" style="margin-top: 40px;">下一步，提交投资人偏好信息</button>
							</form>
						</div>

						<div class="col-xs-8 col-xs-offset-2 zhuche_progress2">
							<div class="zhube_head clearfix">
								<h3 class="text-center">认证投资人</h3>
								<div class="row text-center"><span class="col-xs-4  active">第一步：提交身份信息</span> <span class="col-xs-4">>>></span><span class="col-xs-4 ">第二步：提交研究偏好信息</span></div>
							</div>
							<form class="form-horizontal " id="form_check" enctype="multipart/form-data" >
							<div class="form-group">
								<div class="row">
									<h5 class="col-xs-2 text-right">投资领域</h5>
								</div>
							  	
							<div class="row " style="padding-bottom: 20px;padding-left: 20px;">	
								<div class="col-xs-offset-2 " id="area_out">
									<label class="checkbox-inline col-xs-2 " style="margin-left: 10px;">
									  <input type="checkbox" name="areas"  value="option1">汽车交通
									</label>
									
									
									
								</div>
								
							</div>
							
							<input type="hidden" name="investField" id="investField" datatype='*' nullmsg="请选择投资领域！" value="" />
							  </div>
							  
							  
							  <div class="form-group">
								<div class="row">
									<h5 class="col-xs-2 text-right">偏好轮次</h5>
								</div>
							  	
							<div class="row " style="padding-bottom: 20px;padding-left: 20px;">	
								<div class="col-xs-offset-2 " id="preference_">
									<label class="checkbox-inline col-xs-2 " style="margin-left: 10px;">
									  <input type="checkbox" name="pref"  value="1">汽车交通
									</label>
									
								</div>
								
							</div>
							
							<input type="hidden" name="preference" id="preference" datatype='*' nullmsg="请选择偏好轮次！" value="" />
							  </div>
							
							<div class="form-inline" style="padding: 20px 0;">
								<div class="form-group" style="margin-left: 0;">
							    <label for="exampleInputEmail3" style="">单笔投资金额</label>
							    <input type="email" class="form-control" id="exampleInputEmail3" placeholder="输入具体金额" datatype='*' nullmsg="请输入具体金额！" style="margin: 0 10px;">
							    <span>人民币</span>
							  </div>
							</div>
							
							
							<div class="form-group" style="margin: 20px 0 30px;">
							    <label for="up" class="col-sm-2 control-label" style=" text-align: left;font-weight: normal;">个人名片</label>
							    <div class="col-sm-8">
							    	<div class="sub_logo col-xs-4">
							    	<img src="../img/020.jpg"style="vertical-align: middle;width: 90px;height: 90px;"  id="ImgPr"/>
							    		<input type="file" id="up" name="pic" datatype='*' nullmsg="请上传个人名片" value="" />
							    	</div>
							    <span class="media-middle" style="display: inline-block;margin-top: 30px;">建议上传尺寸90mm*50mm</span>
							    </div>
							  </div>

								<div class="form-group" style="margin: 20px 0 30px;">
									<label for="up2" class="col-sm-2 control-label" style=" text-align: left;font-weight: normal;">头像</label>
									<div class="col-sm-8">
										<div class="sub_logo col-xs-4">
											<img src="../img/020.jpg"style="vertical-align: middle;width: 90px;height: 90px;"  id="ImgPr2"/>
											<input type="file" id="up2" name="avatarPic" datatype='*' nullmsg="请上传头像" value="" />
										</div>
										<span class="media-middle" style="display: inline-block;margin-top: 30px;">建议上传尺寸90mm*50mm</span>
									</div>
								</div>
							  
							  <input type="hidden" name="realName"  value="" />
							  <input type="hidden" name="email"  value="" />
							  <input type="hidden" name="weChat"  value="" />
							  <input type="hidden" name="identity"  value="" />
							  <input type="hidden" name="institution"  value="" />
							  <input type="hidden" name="dept"  value="" />
							  <input type="hidden" name="userId" id="userId" value="" />
							
							<div class="row"><button class="btn btn-default col-xs-3 col-xs-offset-3 btn_back" >上一步</button> <button class="btn btn-default col-xs-3 submit_btn" style="margin-left: 50px;">提交</button></div> 							
							</form>
						</div>
				</div>
		</div>
		
		</div>
	</body>
	<script src="../js/jquery-2.1.1.min.js"></script>
	<script type="text/javascript" src="../js/bootstrap.min.js" ></script>
	<script type="text/javascript" src="../js/Validform_v5.3.2_min.js" ></script>
	<script type="text/javascript" src="../js/uploadimg.js" ></script>
	<script type="text/javascript" src="../js/public.js"></script>
	<script type="text/javascript">
        var person = JSON.parse(sessionStorage.getItem("person"));
        if (person==''||person==null) {
			alert('请先登录')
			 window.location.href='denglu.html';
        } else{
            var userId = person.userid;
            console.log(userId)
            $('#userId').val(userId)

        }
		
 $("#up").uploadPreview({ Img: "ImgPr", Width: 120, Height: 120 });
 $("#up2").uploadPreview({ Img: "ImgPr2", Width: 120, Height: 120 });

 var realName = "";
 var email = "";
 var weChat = "";
 var identity = "";
 var institution = "";
 var dept = "";
 
 
 $("#form_test").Validform({
			btnSubmit:".btn_next",
			tiptype:1,
		beforeSubmit:function(){
			realName = $('#realName').val();
			email = $('#email').val();
			weChat = $('#weChat').val();
			identity = $('#identity').val();
			institution = $('#institution').val();
			dept = $('#dept').val();
			$(".zhuche_progress1").hide();
			$(".zhuche_progress2").show()
		return false;
		}
		
	});
	
	$("#form_check").Validform({
			btnSubmit:".submit_btn",
			tiptype:1,
		beforeCheck:function(curform){
//		$('#open').val(tansformData($('#open_').val()))
//		$('#yixing').val(tansformData($('#yixing_').val())) 
			var domains = '';
			var pres = "";
			 $('input[name="areas"]:checked').each(function(){    
			   domains+=$(this).val()+','
			  });  
			domains=domains.substring(0,domains.length-1);
			  console.log(domains);
			  $('#investField').val(domains)	
			  
			  $('input[name="pref"]:checked').each(function(){    
			   pres+=$(this).val()+','
			  });  
			pres=pres.substring(0,pres.length-1);
			  console.log(pres);
			  $('#preference').val(pres)	
		},
		beforeSubmit:function(){
			console.log($('#up').val())
			$('input[name="realName"]').val(realName);
			$('input[name="email"]').val(email)
			$('input[name="weChat"]').val(weChat)
			$('input[name="identity"]').val(identity)
			$('input[name="institution"]').val(institution)
			$(".zhuche_progress1").hide();
			$(".zhuche_progress2").show()
			doUpload();
			return false;
		}
		
	});
		
		$(".zhuche_progress2").hide();
		$('.btn_back').on("click",function(){
			$(".zhuche_progress1").show();
			$(".zhuche_progress2").hide()
		})
		
	function doUpload() {  
     var formData = new FormData($( "#form_check" )[0]);  
     $.ajax({  
          url: 'http://114.112.96.184:18080/auth/invest' ,
          type: 'POST',  
          data: formData,  
          async: false,  
          cache: false,  
          contentType: false,  
          processData: false,  
          success: function (data) {  
           console.log(data);
           if (data.code==000) {
           	window.location.href='touziren_index.html';
           } else{
           	
           }
          },  
          error: function (returndata) {  
              alert(returndata);  
          }  
     });  
}  



		$.ajax({
                type: "get",
                url:"http://114.112.96.184:18080/dict/field",
                error: function(request) {
                    alert("Connection error");
                },
                success: function(data) {
                	console.log(data)
                   var obj = data.result;
                   var htmls='';
                   for (var i = 0; i < obj.length;i++) {
                   	htmls+= '<label class="checkbox-inline col-xs-2" style=""><input type="checkbox" name="areas"  value="'+ obj[i].id +'">'+obj[i].value+'</label>'
                   }
                   $('#area_out').html(htmls);
                }
            });
            
            
            $.ajax({
                type: "get",
                url:"http://114.112.96.184:18080/dict/financingStage",
                error: function(request) {
                    alert("Connection error");
                },
                success: function(data) {
                	console.log(data)
                   var obj = data.result;
                   var htmls='';
                   for (var i = 0; i < obj.length;i++) {
                   	htmls+= '<label class="checkbox-inline col-xs-2" style=""><input type="checkbox" name="pref"  value="'+ obj[i].id +'">'+obj[i].value+'</label>'
                   }
                   $('#preference_').html(htmls);
                }
            });
            
            
	</script>
</html>
